package com.exchange.controller.app.optional;

import com.exchange.controller.BaseController;
import com.exchange.interceptor.AppUserTokenInterceptor;
import com.jfinal.aop.Before;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Ret;

/**
 * 用户自选相关
 */
@Before({OptioalValidator.class,AppUserTokenInterceptor.class})
public class OptioalController extends BaseController {
	
	@Inject
	OptioalService service;
	
	/**
     * 用户添加/取消自选货币
     */
    public void optional(String coin, String market) {
    	Ret ret = service.optional(getAttr("user"), coin, market);
    	renderJson(ret);
    }

    /**
     * 我的自选
     */
    public void favor() {
    	Ret ret = service.favor(getAttr("user"));
    	renderJson(ret);
    }
    
    /**
     * 是否已选
     */
    public void favorByCoinTeam(String coin, String market) {
    	Ret ret = service.favorByCoinTeam(getAttr("user"), coin, market);
    	renderJson(ret);
    }
    
    
    
    
    
    
    
    
    
    
    
}
